
var messages = new Vue();
define(function (require,exports,module) {

    const routes = [
        {
            path: '/groundServiceScheduling/serviceBill', component: function (resolve) {
                    require.async(['mobileModules/serviceBill/serviceBill.js'],resolve);
            }
        },
        {
            path: '/processControl/processKanban/', component: function (resolve) {
            require.async(['modules/processControl/processKanban/processKanban.js'], resolve);
        }
        }
    ]

    const router = new VueRouter({
        routes:routes // （缩写）相当于 routes: routes
    })
    router.beforeEach(function(to, from, next) {
        next();
        console.log(to);
        if(allrights.init){
            to.params.rights = allrights[to.path]?allrights[to.path].rights?allrights[to.path].rights:[]:[];
            to.params.rights.init=true;
        }else{
            to.params.rights=[];
            to.params.rights.init=false;
        }
    });
// 4. 创建和挂载根实例。
// 记得要通过 router 配置参数注入路由，
// 从而让整个应用都有路由功能
    Vue.use(MuseUI);
     app = new Vue({
        el:"#app",
        router:router,
        data:{
            tittle:"首页",
            docked: false,
            open: true,
            position: 'left'

        },
        created:function (){
            var $this = this;
            messages.$on('change',function(value) {
                document.title=value;
                $this.tittle = value;
            });
        }
    }).$mount('#app')
});